﻿@{
    View.Title = "Reindex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    function getProgress() {
        $.getJSON("./ReindexProgress", { rand: Math.random() },
                function (data) {
                    $("#Reindex-progressbar").progressbar("value", data.progress);
                    $("#Reindex-progress span").html(data.message);
                    if (parseInt(data.progress) < 100) {
                        window.setTimeout("getProgress()", 300);
                    }
                }
            );
    }

    $(function () {
        $("#Reindex-progressbar").progressbar({
            value: 0
        });

        // Poll to check the progress
        getProgress();
    });
</script>
<h2>
    Reindex</h2>
<div class="progress">
    <h3>
        Reindex Progress</h3>
    <div id="Reindex-progressbar">
    </div>
    <div id="Reindex-progress">
        <span></span>
    </div>
</div>
